3.7.67 \(\int \frac {x^{-1+3 n} (a+b x^n)^2}{c+d x^n} \, dx\)

Optimal. Leaf size=118 \[ \frac {c^2 (b c-a d)^2 \log \left (c+d x^n\right )}{d^5 n}-\frac {c x^n (b c-a d)^2}{d^4 n}+\frac {x^{2 n} (b c-a d)^2}{2 d^3 n}-\frac {b x^{3 n} (b c-2 a d)}{3 d^2 n}+\frac {b^2 x^{4 n}}{4 d n} \]

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {446, 88} \begin {gather*} \frac {c^2 (b c-a d)^2 \log \left (c+d x^n\right )}{d^5 n}-\frac {c x^n (b c-a d)^2}{d^4 n}+\frac {x^{2 n} (b c-a d)^2}{2 d^3 n}-\frac {b x^{3 n} (b c-2 a d)}{3 d^2 n}+\frac {b^2 x^{4 n}}{4 d n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x^(-1 + 3*n)*(a + b*x^n)^2)/(c + d*x^n),x]

[Out]

-((c*(b*c - a*d)^2*x^n)/(d^4*n)) + ((b*c - a*d)^2*x^(2*n))/(2*d^3*n) - (b*(b*c - 2*a*d)*x^(3*n))/(3*d^2*n) + (
b^2*x^(4*n))/(4*d*n) + (c^2*(b*c - a*d)^2*Log[c + d*x^n])/(d^5*n)

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rubi steps

\begin {align*} \int \frac {x^{-1+3 n} \left (a+b x^n\right )^2}{c+d x^n} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 (a+b x)^2}{c+d x} \, dx,x,x^n\right )}{n}\\ &=\frac {\operatorname {Subst}\left (\int \left (-\frac {c (b c-a d)^2}{d^4}+\frac {(-b c+a d)^2 x}{d^3}-\frac {b (b c-2 a d) x^2}{d^2}+\frac {b^2 x^3}{d}+\frac {c^2 (b c-a d)^2}{d^4 (c+d x)}\right ) \, dx,x,x^n\right )}{n}\\ &=-\frac {c (b c-a d)^2 x^n}{d^4 n}+\frac {(b c-a d)^2 x^{2 n}}{2 d^3 n}-\frac {b (b c-2 a d) x^{3 n}}{3 d^2 n}+\frac {b^2 x^{4 n}}{4 d n}+\frac {c^2 (b c-a d)^2 \log \left (c+d x^n\right )}{d^5 n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.27, size = 103, normalized size = 0.87 \begin {gather*} \frac {12 c^2 (b c-a d)^2 \log \left (c+d x^n\right )-4 b d^3 x^{3 n} (b c-2 a d)+6 d^2 x^{2 n} (b c-a d)^2-12 c d x^n (b c-a d)^2+3 b^2 d^4 x^{4 n}}{12 d^5 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x^(-1 + 3*n)*(a + b*x^n)^2)/(c + d*x^n),x]

[Out]

(-12*c*d*(b*c - a*d)^2*x^n + 6*d^2*(b*c - a*d)^2*x^(2*n) - 4*b*d^3*(b*c - 2*a*d)*x^(3*n) + 3*b^2*d^4*x^(4*n) +
 12*c^2*(b*c - a*d)^2*Log[c + d*x^n])/(12*d^5*n)

________________________________________________________________________________________

IntegrateAlgebraic [A]  time = 0.10, size = 141, normalized size = 1.19 \begin {gather*} \frac {x^n \left (-12 a^2 c d^2+6 a^2 d^3 x^n+24 a b c^2 d-12 a b c d^2 x^n+8 a b d^3 x^{2 n}-12 b^2 c^3+6 b^2 c^2 d x^n-4 b^2 c d^2 x^{2 n}+3 b^2 d^3 x^{3 n}\right )}{12 d^4 n}+\frac {c^2 (b c-a d)^2 \log \left (c+d x^n\right )}{d^5 n} \end {gather*}

Antiderivative was successfully verified.

[In]

IntegrateAlgebraic[(x^(-1 + 3*n)*(a + b*x^n)^2)/(c + d*x^n),x]

[Out]

(x^n*(-12*b^2*c^3 + 24*a*b*c^2*d - 12*a^2*c*d^2 + 6*b^2*c^2*d*x^n - 12*a*b*c*d^2*x^n + 6*a^2*d^3*x^n - 4*b^2*c
*d^2*x^(2*n) + 8*a*b*d^3*x^(2*n) + 3*b^2*d^3*x^(3*n)))/(12*d^4*n) + (c^2*(b*c - a*d)^2*Log[c + d*x^n])/(d^5*n)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 146, normalized size = 1.24 \begin {gather*} \frac {3 \, b^{2} d^{4} x^{4 \, n} - 4 \, {\left (b^{2} c d^{3} - 2 \, a b d^{4}\right )} x^{3 \, n} + 6 \, {\left (b^{2} c^{2} d^{2} - 2 \, a b c d^{3} + a^{2} d^{4}\right )} x^{2 \, n} - 12 \, {\left (b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x^{n} + 12 \, {\left (b^{2} c^{4} - 2 \, a b c^{3} d + a^{2} c^{2} d^{2}\right )} \log \left (d x^{n} + c\right )}{12 \, d^{5} n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+3*n)*(a+b*x^n)^2/(c+d*x^n),x, algorithm="fricas")

[Out]

1/12*(3*b^2*d^4*x^(4*n) - 4*(b^2*c*d^3 - 2*a*b*d^4)*x^(3*n) + 6*(b^2*c^2*d^2 - 2*a*b*c*d^3 + a^2*d^4)*x^(2*n)
- 12*(b^2*c^3*d - 2*a*b*c^2*d^2 + a^2*c*d^3)*x^n + 12*(b^2*c^4 - 2*a*b*c^3*d + a^2*c^2*d^2)*log(d*x^n + c))/(d
^5*n)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (b x^{n} + a\right )}^{2} x^{3 \, n - 1}}{d x^{n} + c}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+3*n)*(a+b*x^n)^2/(c+d*x^n),x, algorithm="giac")

[Out]

integrate((b*x^n + a)^2*x^(3*n - 1)/(d*x^n + c), x)

________________________________________________________________________________________

maple [B]  time = 0.07, size = 236, normalized size = 2.00 \begin {gather*} \frac {a^{2} c^{2} \ln \left (d \,{\mathrm e}^{n \ln \relax (x )}+c \right )}{d^{3} n}-\frac {a^{2} c \,{\mathrm e}^{n \ln \relax (x )}}{d^{2} n}+\frac {a^{2} {\mathrm e}^{2 n \ln \relax (x )}}{2 d n}-\frac {2 a b \,c^{3} \ln \left (d \,{\mathrm e}^{n \ln \relax (x )}+c \right )}{d^{4} n}+\frac {2 a b \,c^{2} {\mathrm e}^{n \ln \relax (x )}}{d^{3} n}-\frac {a b c \,{\mathrm e}^{2 n \ln \relax (x )}}{d^{2} n}+\frac {2 a b \,{\mathrm e}^{3 n \ln \relax (x )}}{3 d n}+\frac {b^{2} c^{4} \ln \left (d \,{\mathrm e}^{n \ln \relax (x )}+c \right )}{d^{5} n}-\frac {b^{2} c^{3} {\mathrm e}^{n \ln \relax (x )}}{d^{4} n}+\frac {b^{2} c^{2} {\mathrm e}^{2 n \ln \relax (x )}}{2 d^{3} n}-\frac {b^{2} c \,{\mathrm e}^{3 n \ln \relax (x )}}{3 d^{2} n}+\frac {b^{2} {\mathrm e}^{4 n \ln \relax (x )}}{4 d n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(3*n-1)*(b*x^n+a)^2/(d*x^n+c),x)

[Out]

1/4*b^2/d/n*exp(n*ln(x))^4+1/2/d/n*exp(n*ln(x))^2*a^2-1/d^2/n*exp(n*ln(x))^2*a*b*c+1/2/d^3/n*exp(n*ln(x))^2*b^
2*c^2+2/3*b/d/n*exp(n*ln(x))^3*a-1/3*b^2/d^2/n*exp(n*ln(x))^3*c-c/d^2/n*exp(n*ln(x))*a^2+2*c^2/d^3/n*exp(n*ln(
x))*a*b-c^3/d^4/n*exp(n*ln(x))*b^2+c^2/d^3/n*ln(d*exp(n*ln(x))+c)*a^2-2*c^3/d^4/n*ln(d*exp(n*ln(x))+c)*a*b+c^4
/d^5/n*ln(d*exp(n*ln(x))+c)*b^2

________________________________________________________________________________________

maxima [A]  time = 0.54, size = 192, normalized size = 1.63 \begin {gather*} \frac {1}{12} \, b^{2} {\left (\frac {12 \, c^{4} \log \left (\frac {d x^{n} + c}{d}\right )}{d^{5} n} + \frac {3 \, d^{3} x^{4 \, n} - 4 \, c d^{2} x^{3 \, n} + 6 \, c^{2} d x^{2 \, n} - 12 \, c^{3} x^{n}}{d^{4} n}\right )} - \frac {1}{3} \, a b {\left (\frac {6 \, c^{3} \log \left (\frac {d x^{n} + c}{d}\right )}{d^{4} n} - \frac {2 \, d^{2} x^{3 \, n} - 3 \, c d x^{2 \, n} + 6 \, c^{2} x^{n}}{d^{3} n}\right )} + \frac {1}{2} \, a^{2} {\left (\frac {2 \, c^{2} \log \left (\frac {d x^{n} + c}{d}\right )}{d^{3} n} + \frac {d x^{2 \, n} - 2 \, c x^{n}}{d^{2} n}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+3*n)*(a+b*x^n)^2/(c+d*x^n),x, algorithm="maxima")

[Out]

1/12*b^2*(12*c^4*log((d*x^n + c)/d)/(d^5*n) + (3*d^3*x^(4*n) - 4*c*d^2*x^(3*n) + 6*c^2*d*x^(2*n) - 12*c^3*x^n)
/(d^4*n)) - 1/3*a*b*(6*c^3*log((d*x^n + c)/d)/(d^4*n) - (2*d^2*x^(3*n) - 3*c*d*x^(2*n) + 6*c^2*x^n)/(d^3*n)) +
 1/2*a^2*(2*c^2*log((d*x^n + c)/d)/(d^3*n) + (d*x^(2*n) - 2*c*x^n)/(d^2*n))

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^{3\,n-1}\,{\left (a+b\,x^n\right )}^2}{c+d\,x^n} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^(3*n - 1)*(a + b*x^n)^2)/(c + d*x^n),x)

[Out]

int((x^(3*n - 1)*(a + b*x^n)^2)/(c + d*x^n), x)

________________________________________________________________________________________

sympy [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(-1+3*n)*(a+b*x**n)**2/(c+d*x**n),x)

[Out]

Exception raised: HeuristicGCDFailed

________________________________________________________________________________________